﻿@using DataMongo
@model IEnumerable<DataMongo.Entities.SourceDetail>
@{
    ViewBag.Title = "Source Details";
    
}
<div class="row">
    <div class="col-lg-12">
        <h2>Source Detail - @UtilityService.GetSourceNameById(ViewBag.SourceId)</h2>

        <p>@Html.ActionLink("Create", "SourceDetailAdd", new { sourceId = ViewBag.SourceId},new{@class = "btn btn-info" })
        @Html.ActionLink("Extract Feeds", "ExtractSource", "SuperAdmin", new { id = ViewBag.SourceId }, new { @class = "btn btn-info" })
        </p>
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped tablesorter">
                <thead>
                    <tr>
                        <th>Title <i class="fa fa-sort"></i></th>
                        <th>Source <i class="fa fa-sort"></i></th>
                        <th>Category <i class="fa fa-sort"></i></th>
                        <th>Feed URL<i class="fa fa-sort"></i></th>
                        <th>Is Active <i class="fa fa-sort"></i></th>
                        
                        <th width="15%">

                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.Title</td>
                            <td>@UtilityService.GetSourceNameById(item.SourceId)</td>
                            <td>@UtilityService.GetCategoryNameById(item.CategoryId)</td>
                            <td>
                                @item.FeedURL
                            </td>
                            <td>
                                @if (item.IsActive)
                                {
                                    <input type="checkbox" disabled="disabled" checked="checked" />
                                }
                                else
                                {
                                    <input type="checkbox" disabled="disabled" />
                                }

                            </td>
                            <td>
                                @Html.ActionLink("Edit", "SourceDetailEdit", new { id = item.SourceDetailId }) |
                                @Html.ActionLink("Delete", "SourceDetailDelete", new { id = item.SourceDetailId }) |
                                @Html.ActionLink("Extract Feed", "ExtractSourceUrl", new { id = item.SourceDetailId })
                                
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
